package com.elementum.olegomatic.util;

import com.elementum.olegomatic.persist.Tweet;
import com.mongodb.DBObject;

import java.util.StringTokenizer;

/**
 * Created with IntelliJ IDEA.
 * User: ravikolli
 * Date: 10/9/13
 * Time: 8:52 PM
 * To change this template use File | Settings | File Templates.
 */
public class TweetUtil {

    public Tweet getTweet(DBObject tweet){

        Tweet receivedTweet;

        receivedTweet= new Tweet(tweet.get("_id").toString(),tweet.get("body").toString());

        return receivedTweet;
    }

    public String[] getTweetWords(Tweet t){
        String[] words = null;

        String tweetBody = t.getBody();

        words = tweetBody.split(" ");

        return words;
    }

}
